#pragma once

#ifndef _INC_JSONPostGet_
#define _INC_JSONPostGet_

#ifdef CEJSONAPI_EXPORTS
#define CEJSONAPI_API __declspec(dllexport)
#else
#define CEJSONAPI_API __declspec(dllimport)
#endif

/*// This class is exported from the CEJSONLIB.dll
class CEJSONAPI_API CCEJSONLIB {
public:
	CCEJSONLIB(void);
	// TODO: add your methods here.
};

extern CEJSONAPI_API int nCEJSONLIB;

CEJSONAPI_API int fnCEJSONLIB(void);*/


#define NL "\r\n"
//Next is carry over from Arduino TODO: Removeit
#define F(strn)  strn
#define delay  Sleep
#define MAXPACKET 2024
#define MAXLINE  2024

#define SIZE_OF_SERVERNAME 50
#define SIZE_OF_APPKEY 50
#define SIZE_OF_TABLENAME 50

// Microsoft Azure Mobile Service parameters:
extern char TABLE[SIZE_OF_TABLENAME]; //        "telemetry2"
extern char AMW_SERVICE[SIZE_OF_SERVERNAME]; //  "sportronicsdj.azure-mobile.net"
extern char APP_KEY[SIZE_OF_APPKEY];        //"NtcMLPQtuAqWtvXOwrZVQtqHevNUnN27"
#define TEST false




extern "C" CEJSONAPI_API BOOL GET_TelemetryTable(char * table, bool enableOutput);
extern "C" CEJSONAPI_API BOOL GET_TelemetryTableFltr(char * table, char * filter, bool enableOutput);
extern "C" CEJSONAPI_API BOOL POST_TelemetryValue(char * table, char * name, int value, bool enableOutput);
extern "C" CEJSONAPI_API BOOL POST_TelemetryValueFlt(char * table, char * name, float value, bool enableOutput);
extern "C" CEJSONAPI_API BOOL PATCH_TelemetryRecord(char * table, int id, char *Field, int Value, bool enableOutput);
extern "C" CEJSONAPI_API BOOL DELETE_TelemetryRecord(char * table, int id, bool enableOutput);
extern "C" CEJSONAPI_API void Init_AZMS(char* azms, char * table, char * appKey);


enum HTTPModeEnum
{
	DOGET,
	DOPOST,
	DOPATCH,
	DODELETE
};

extern "C" CEJSONAPI_API BOOL GetResponse(HTTPModeEnum httpMode, bool enableOutput);

extern "C" CEJSONAPI_API void	InitNameValues();
//int		AddNameValue(NameValue item, int recordNo, int fieldIndex);
extern "C" CEJSONAPI_API void	DeallocateNameValues();
extern "C" CEJSONAPI_API void	CheckArray();
extern "C" CEJSONAPI_API void	PrintArray();
extern "C" CEJSONAPI_API void	DisplayANameValuePair(int rec_no, int nv_no);
//void	AddRecord(NameValue item, int index, int recordNo, int fieldIndex);



#endif _INC_JSONPostGet_







